package cn.wolfcode.wolf2w.business.util;

import lombok.Getter;

@Getter
public enum DayType {
    TYPE1(1,0,3),
    TYPE2(2,4,7),
    TYPE3(3,8,14),
    TYPE4(4,15,Integer.MAX_VALUE);

    private Integer type;
    private Integer minDay;
    private Integer maxDay;

    DayType(Integer type, Integer minDay, Integer maxDay) {
        this.type=type;
        this.minDay=minDay;
        this.maxDay=maxDay;
    }

    public static DayType getDayByType(Integer type){
        for(DayType value:DayType.values()){
            if (value.getType().equals(type)){
                return value;

            }
        }
        return null;
    }
}
